#!/bin/bash
if [ ! -d nginx-1.17.6 ]; then
 tar xzvf nginx-1.17.6.tar.gz
 unzip echo-nginx-module-master.zip
fi

pushd nginx-1.17.6
#echo 是方便conf配置输出的模块，测试用　
#--with-debug 方便调试详细的信息输出
 ./configure --prefix=/opt/dev/nginx17 --with-debug --add-module=../echo-nginx-module-master
 make install
popd

#测试用的页面
if [ ! -d /opt/csbit/web ]; then
 tar -xvzf webpage/tomcat8.tar.gz -C /opt/csbit/web/
fi

#部署在我们的测试tomcat上　
if [ ! -f /opt/csbit/web/webapps/ROOT/a.htm ]; then
 cp -rf webpage/* /opt/csbit/web/webapps/ROOT/.

 #http的tomcat配置　nginx代理的　http://localhost:8080
 cp -f webpage/server.xml /opt/csbit/web/conf/.
fi
